Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I did
@given
property-based testing.report_multiple_bugs
- closes Stateful testing exception output is difficult to read #567How I did it
Previously, a snapshot was taken at the beginning of each test run and reverted to at the end. This caused an issue where if a test failed, the revert didn't occur and so the previous run's state leaked into future runs as hypothesis shrinks the failing example.
I have adjusted the logic so that the snapshot is only taken prior to the first run, and prior to each subsequent run a revert occurs. Handling these actions before any test logic ensures they always occur, and moving the revert to the beginning means that if a test fails, it's still possible to use
-I
to drop in with the correct failing state.Finally, I disabled
report_multiple_bugs
as a quick solution to the long and difficult-to-read traceback delivered from hypothesis'MultipleFailures
.How to verify it
Run the tests.